home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
pc_dcl.zip
/
HELP
/
CLOSE.HTX
< prev
next >
Wrap
Text File
|
1992-01-08
|
2KB
|
81 lines
CLOSE
CLOSE
Closes a file that was opened for input or output with the OPEN
command, and deassigns the logical name specified when the file was
opened.
Format:
CLOSE logical-name[:]
Additional information :
logical-nameclose.logical-name /ERRORclose.logical-name /LOGclose./log
Examplesclose.examples
close.logical-name
CLOSE
logical-name[:]
Specifies the logical name assigned to the file when it was opened
with the OPEN command.
/ERROR=label
Specifies a label in the command procedure to receive control if an
error occurs when you are closing a file that was opened with the
OPEN command. The error routine specified for this qualifier takes
precedence over any action statement indicated in an ON command. If
/ERROR is not specified and an error occurs during the closing of
the file, the current ON condition action is taken.
If an error occurs and the target label is successfully given
control, the global symbol $STATUS retains the code for the error
that caused the error path to be taken.
close./log
CLOSE
/LOG
Controls whether a warning message is generated when you attempt to
close a file that was not opened by DCL. If you specify the /ERROR
qualifier, the /LOG qualifier has no effect. If the file has not
been opened by DCL, the error branch is taken and no message is
displayed.
close.examples
Examples
1. $ OPEN/READ INPUT_FILE TEST.DAT
$ READ_LOOP:
$ READ/END_OF_FILE=NO_MORE INPUT_FILE DATA_LINE
.
.
.
$ GOTO READ_LOOP
$ NO_MORE:
$ CLOSE INPUT_FILE
The OPEN command opens the file TEST.DAT and assigns it the logical
name of INPUT_FILE. The /END_OF_FILE qualifier on the READ command
requests that, when the end-of-file is reached, the command
interpreter should transfer control to the line at the label
NO_MORE. The CLOSE command closes the input file.